#region History

/* --------------------------------------------------------------------------------
 * Client Name: Bd Market Ltd.
 * Project Name: BdMarket
 * Module: RH.Web.ViewModels 
 * Name: Transaction.cs
 * Purpose: ViewModel class for Transaction
 *                   
 * Author: Md. Hassanur Rahman
 * Language: C# SDK Version 4.0
 * --------------------------------------------------------------------------------
 * Change History:
 * Version: 1.0    MHR  01/21/2012
 * Description: Initial Development
 * -------------------------------------------------------------------------------- */

#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;


namespace RH.Web.ViewModels
{
    [Serializable]
	public class TransactionViewModel : BaseViewModel
	{
        private List<TransactionDetailViewModel> _transactionDetails = new List<TransactionDetailViewModel>();
        /// <summary>
		/// Gets or sets the ID
		/// </summary>
        public int ID { get; set;}
            
        [StringLength(50, ErrorMessage = "The {0} can be maximum {2} characters long.")]
        [Display(Name = "Transaction No")] 
		public String Code	{ get; set; }

        [StringLength(50, ErrorMessage = "The {0} can be maximum {2} characters long.")]
        [Display(Name = "Reference No")] 
        public String ReferenceNo { get; set; }
            
        [Display(Name = "Transaction Date")] 
		public String TransactionDate	{ get; set; }
            
        [StringLength(500, ErrorMessage = "The {0} can be maximum {2} characters long.")]
        [Display(Name = "Description")] 
		public String Description	{ get; set; }

        [Required(ErrorMessage = "Please Choose Is Issued?")]
        [Display(Name = "Is Issued")]
        public String IsIssue { get; set; }

        [Required(ErrorMessage = "Please Choose Is Received?")]
        [Display(Name = "Is Received")]
        public String IsReceive { get; set; }

        [Required(ErrorMessage = "Please Select a Store")]
        [Range(1, int.MaxValue, ErrorMessage = "Please Select a Store")]
        [Display(Name = "Store")]
        public int StoreID { get; set; }

        [Required(ErrorMessage = "Please Enter a Created On")]
        [Display(Name = "Created On")]
        public String CreatedOn { get; set; }

        [Required(ErrorMessage = "Please Enter a Createb By")]
        [Display(Name = "Createb By")]
        public String CreatebBy { get; set; }

        [Required(ErrorMessage = "Please Enter a Modified On")]
        [Display(Name = "Modified On")]
        public String ModifiedOn { get; set; }

        [Required(ErrorMessage = "Please Enter a Modified By")]
        [Display(Name = "Modified By")]
        public String ModifiedBy { get; set; }

        [Display(Name="Transaction Details")]
        public List<TransactionDetailViewModel> TransactionDetails
        {
            get { return _transactionDetails; }
            set { _transactionDetails = value; }
        }

        //[Required(ErrorMessage = "Please Choose Is Issued?")]
        //[Display(Name = "Is Issued")]
        public String IsPosted { get; set; }
	}
}

